using UnityEngine;

public class ColliderEvents : MonoBehaviour
{
	public delegate void ColliderTriggerEvent(Collider other);

	public delegate void ColliderCollisionEvent(Collision collision);

	public ColliderTriggerEvent onTriggerEnter;

	public ColliderTriggerEvent onTriggerExit;

	public ColliderCollisionEvent onCollisionEnter;

	public ColliderCollisionEvent onCollisionExit;

	private void OnTriggerEnter(Collider other)
	{
		if (onTriggerEnter != null)
		{
			onTriggerEnter(other);
		}
	}

	private void OnTriggerExit(Collider other)
	{
		if (onTriggerExit != null)
		{
			onTriggerExit(other);
		}
	}

	private void OnCollisionEnter(Collision collision)
	{
		if (onCollisionEnter != null)
		{
			onCollisionEnter(collision);
		}
	}

	private void OnCollisionExit(Collision collision)
	{
		if (onCollisionExit != null)
		{
			onCollisionExit(collision);
		}
	}
}
